home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / SiF-tCNC.asm < prev    next >
Encoding:
Assembly Source File  |  1999-08-20  |  2.1 KB  |  117 lines

  1. ; Keygen for Terminal Cilla Newbie Challenge Volume 1
  2. ; by SiFLyiNG 20/08/99
  3. ;
  4. ;
  5.  
  6. .Model Tiny
  7.  
  8. .386
  9.  
  10. .Data
  11.  
  12. Intro        Db    0Ah, 0Dh, 'Keygen for tC Newbie Challenge Volume 1 by SiFLyiNG'
  13.         Db     0Ah, 0Dh
  14.         Db    'Enter your name (at least 5 characters without space) : ', '$'
  15. Max        Db    20h
  16. Lenght        Db    0
  17. RegName        Db    20h DUP (0)
  18. Serial        Db    20h DUP (0),'$'
  19. Output        Db    0Ah, 0Dh, 'Your serial is :    ' ,'$'
  20. BadName        Db    0Ah, 0Dh, 'Hey !!! Your name must be at least 5 chars long !!!','$'
  21. SpaceChar    Db     0Ah, 0Dh, 'Hey !!! I told you WITHOUT space !!!','$'
  22. Line        Db    0Ah, 0Dh,'$'
  23.  
  24. .Code
  25.     ORG 100h
  26.  
  27. Main:
  28.     Lea EDX, [Intro]
  29.     Call Print
  30.     Lea DX, [Max]
  31.     Call Get
  32.     Cmp byte ptr [lenght], 05    ; name > or = 5 chars ?
  33.     Jae Next            ; if lenght name > or = 5 then jump
  34.     
  35.     Lea DX, [BadName]
  36.     Call Print
  37.     Jmp Exit
  38. Next:    
  39.     Xor ecx, ecx
  40.  
  41. ; This loop looks for any space characters in the name. 
  42.  
  43. SeekSpace:
  44.     Movzx eax, byte ptr [RegName+ecx]
  45.     Cmp al, 20h        ; 20h = ascii value of space character
  46.     Jnz OtherChar        
  47.     Lea DX, [SpaceChar]    ; if there is a space in the name
  48.     Call Print
  49.     Jmp Exit    
  50. OtherChar:
  51.     Inc ecx
  52.     Cmp cl, byte ptr [Lenght]
  53.     Jnz SeekSpace
  54.  
  55. ; this loop converts the name in upper case
  56.     xor ecx, ecx
  57. UpperCase:
  58.     Movzx eax, byte ptr [RegName+ecx]
  59.     Cmp al, 61h
  60.     Jb NextChar
  61.     Cmp al, 7Ah
  62.     Ja NextChar
  63.     Sub al, 20h
  64.     Mov byte ptr [RegName+ecx], al
  65. NextChar:    
  66.     Inc ecx
  67.     Cmp cl,byte ptr [Lenght]
  68.     Jnz UpperCase
  69.  
  70. ; this loop calculates the valid serial
  71.     Xor ecx, ecx
  72.     Mov byte ptr [Serial], 31h
  73.     Movzx ebx, byte ptr [Lenght]
  74.     Dec ebx
  75. Calculation:
  76.     Movzx eax, byte ptr [RegName+ecx]
  77.     Push eax
  78.     Movzx eax, byte ptr [Serial+ecx]
  79.     Pop edx
  80.     Add edx, eax
  81.     Push edx
  82.     Movzx eax, byte ptr [RegName+ecx+1]
  83.     Pop edx
  84.     Sub edx, eax
  85.     Mov byte ptr [Serial+ecx+1], dl
  86.     Inc ecx
  87.     Cmp ecx, ebx
  88.     jnz Calculation
  89.  
  90. Finished:
  91.     Lea DX, [Line]
  92.     Call Print        
  93.     Lea DX, [Output]
  94.     Call Print
  95.     Lea DX, [Serial]
  96.     Call Print
  97.     Lea DX, [Line]
  98.     Call Print    
  99. Exit:
  100.     Mov ax, 4C00h
  101.     Int 21h
  102.  
  103.  
  104. Print Proc
  105.     Mov AH, 09h
  106.     Int 21h
  107.     Ret
  108. Print Endp        
  109.  
  110. Get Proc
  111.     Mov AH, 0Ah
  112.     Int 21h
  113.     Ret
  114. Get Endp
  115.  
  116. End Main
  117.